package com.bingbing.back.myUtils;

import com.bingbing.back.dto.SchoolInfoDto;
import com.bingbing.back.dto.SchoolMajorScoreDto;
import com.bingbing.back.dto.VoluntaryDto;
import org.springframework.stereotype.Service;

@Service
public class MyCalProbability {

    public double calMajorProbability(int total, VoluntaryDto voluntaryDto, SchoolMajorScoreDto schoolMajorScoreDto){
        double ans = 0.0;
        int stuScore = voluntaryDto.getStuScore();
        int majorScore = schoolMajorScoreDto.getMajorLoScore();

        int planNum = schoolMajorScoreDto.getRecruitPlan().getPlanNum();

        ans = (stuScore + 25 - majorScore) * 100.0 / 80.0;
        ans = ans * (total - planNum) / total;
        return ans;
    }
}
